<template>
	<scroll-view
		:scroll-y="true"
		@scrolltolower="loadmore">
		<slot></slot>
		<view class="loading" v-show="loading">
			<text>加载中...</text>
		</view>
	</scroll-view>
</template>

<script>
	export default {
		data() {
			return {
				loading: false,
			}
		},
		methods: {
			loadMore() {
				if (this.loading) return
				this.loading = true
				this.$emit('loadMore')
			},
			loadDone() {
				this.loading = false
			}
		}
	}
</script>

<style>
</style>